<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link href="../../../js/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="../../../css/footer.css" />
		<link rel="stylesheet" type="text/css" href="../../../css/lystyle.css"/>
		<link rel="stylesheet" type="text/css" href="../../../css/activity.css" />

		<style type="text/css">
			/*修改底部字体颜色*/
			.foot:nth-child(2) {
				color: #e83023;
			}
			.ly-person {
    position: relative;
    list-style-type: none;
    padding-bottom: 0;
    background: #ffffff;
}
			.ly-person-li{
				   overflow: hidden;
    margin-top: 0.2777rem;
        position: relative;
    width: 100%;
    border: 1px solid #f8f8f8;
    border-left-width: 0px;
    border-right-width: 0px;
        border: none;
        border-bottom: 1px solid #f8f8f8;
			}
			.ly-person-li>span {
    width: 2.5rem;
    display: inline-block;
    float: left;
    padding-left: 0.333333rem;
    /* padding-top: 1.25rem; */
    /* padding-bottom: 1.25rem; */
    line-height: 1.25rem;
    font-size: 0.4444rem;
    color: #4D4D4D;
    overflow: hidden;
}
			.ly-person-li input{
				    float: left;
    border: none;
    /* outline: none; */
    width: 5.5555rem;
    line-height: 1.025rem;
    margin-left: 0.5555rem;
    margin-top: 0.125rem;
			}
.ly-person-li  .fanwei{
	width: 5.2222rem;
}
.ly-person-li.fanweiG input{
	width: 2.7777rem;
}
.ly-person-li.timeG{
	height: 2.2222rem;
}
.ly-person-li.timeG span{
	width: 100%;
}
.ly-person-li.timeG div{
	width: 100%;
	margin-top: 0.9444rem;
}
.ly-person-li.timeG div>*{
	float: left;
	    font-size: 0.3888rem;
	width: 2.7777rem;
	    line-height: 1.025rem;
	    margin-top: 0;
}
#city{
	padding-top: ;
}
		</style>
		<script src="../../../js/flexible.min.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div id="wrap">
			<div id="main">
				<div id="header">
					<a id="headImg" href="../colalition.html"><img class="headImg" src="../../../images/12.png" /></a>
					<p id="headTitle">促销活动</p>
				</div>
				<div id="content">
					<ul class="ly-person">
						<li class="ly-person-li">
							<span>所属区域:</span><span id="city"><a href="citySel.html"></a></span>
						</li>
					</ul>
					<!-- <div class="item">
					<a href="./activity_detail.html"><img class="item-pic" src="../../../images/coalltion/10.jpg" /></a>
				</div> -->
				</div>
			</div>
			<div id="foot" class="row">
				<a class="foot col-xs-3 col-sm-3" href="../../kaoqin/index2.html">
					<img class="footImg" src="../../../images/15.png" />
					<p>管理</p>
				</a>
				<a class="foot col-xs-3 col-sm-3" href="../colalition.html">
					<img class="footImg" src="../../../images/14.png" />
					<p>联盟</p>
				</a>
				<a class="foot col-xs-3 col-sm-3" href="../../store/store.html">
					<img class="footImg" src="../../../images/11.png" />
					<p>商城</p>
				</a>
				<a class="foot col-xs-3 col-sm-3" href="../../personage/personIndex.html">
					<img class="footImg" src="../../../images/13.png" />
					<p>我的</p>
				</a>
			</div>
		</div>
	</body>
	<script src="../../../js/jquery-2.2.3.min.js"></script>
	<script src="../../../js/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
	<script src="../../../js/rhAdmin.js" type="text/javascript" charset="utf-8"></script>
	<script src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js"></script>
	<script src="../../../js/pinyin.js" type="text/javascript" charset="utf-8"></script>
	<script>
		var url = window.location.href;
		var shiji = "";
		$().ready(function() {
			if(url.indexOf("?") > 0 ){
				shiji = decodeURI(url.split("=")[1]);
				$("#city").html(shiji);
				//alert("城市："+shiji);
				if(shiji=="北京市" || shiji=="上海市" || shiji=="天津市" || shiji=="重庆市"){
					//alert("进入专用通道！");
					shiji = shiji.substr(0,shiji.length-1);
					weizhi1(data);
				}else{
					//alert("进入普通通道！");
					$.ajax({
						url: "http://47.104.13.109/user-service/sys/regionName/parent?regionNane="+shiji,
						type: "GET",
						success: function(data) {
							alert(data);
							if(data != null || data != ""){
								weizhi2(data,shiji);
							}
						}
					});
				}
			}else{
				shiji = "";
			}
		})
		
		function weizhi1(saProvinceName){
			$.ajax({
				url: "http://47.104.13.109:80/mall-service/saapply/list2?",
				type: "POST",
				data: {
					pageNum: 1,
					pageSize: 30,
					saProvinceName: saProvinceName
				},
				success: function(data) {
					console.log(data)
					$.each(data.list, function(idx, item) {
						var tpl =
							'<div class="item"><a href="../commodity_details/commodity_details.html?shopId=' + item.siId +
							'"><img class="item-pic" src="' + item.saPicture + '" /></a>' +
							'</div>';
						$('#content').append(tpl);
					})
				},
				error: function(e) {
					console.log('获取优惠活动列表出错:', e);
				}
			});
		}
		function weizhi2(saProvinceName,saCityName){
			$.ajax({
				url: "http://47.104.13.109:80/mall-service/saapply/applyList",
				type: "POST",
				data: {
					pageNum: 1,
					pageSize: 30,
					saProvinceName: saProvinceName,
					saCityName: saCityName
				},
				success: function(data) {
					console.log(data)
					$.each(data.list, function(idx, item) {
						var tpl =
							'<div class="item"><a href="../commodity_details/commodity_details.html?shopId=' + item.siId +
							'"><img class="item-pic" src="' + item.saPicture + '" /></a>' +
							'</div>';
						$('#content').append(tpl);
					})
				},
				error: function(e) {
					console.log('获取优惠活动列表出错:', e);
				}
			});
		}
		
	</script>

</html>